ZipPackageReader.GetFileStream Method

Returns a System.IO.Stream for the file inside the zipped package referenced by filePath.

Parent Type: ZipPackageReader

Namespace: Microsoft.LearningComponents

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public override Stream GetFileStream (
string filePath

)

Parameters

filePath

The file to retrieve. The path is relative to the root of the file hierarchy in the zipped package. If this path indicates a file that is not in the zipped package, a System.IO.FileNotFoundException is thrown.

Return Value

System.IO.Stream for the specified file.

Exceptions
Exception type Condition
IOException

The file is already open.

ArgumentException

filePath contains invalid characters.

ArgumentNullException

filePath is null.

InvalidOperationException

The ZipPackageReader is in an error state.

FileNotFoundException

The file specified was not found.

Permissions
Name Description
System.Security.Permissions.FileIOPermission

for creating directories and reading and writing files. Associated enumerations: System.Security.Permissions.FileIOPermissionAccess.Read and System.Security.Permissions.FileIOPermissionAccess.Write.

Remarks

filePath is a relative path to the root of the zipped package.

The zipped package will be exploded into a temporary directory when this method is called, if not done previously.